package com.example.demo.service;

import com.example.demo.dao.MemberDao;
import com.example.demo.pojo.Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MemberServiceImp implements MemberService{
    @Autowired
    private MemberDao memberDao;

    @Override
    public Member userLogin(Member member) {
        return memberDao.userLogin(member);
    }

    @Override
    public int userReg(Member member) {
        //查询该用户是否存在
        Member member1=memberDao.findMemberByPhone(member);
        if (member1!=null){
            return -1;
        }else {
            return memberDao.userReg(member);
        }

    }
}
